/*
NoBuffer Notepad Copyright (C) 2015  Mahmoud Jaoune

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "notifwidget.h"

NBN_ProgressWidget::NBN_ProgressWidget(QWidget *parent, QString Title, QString Info)
{
    setParent(parent);
    setWindowTitle(Title);
    setWindowFlags(Qt::Dialog);

    setBaseSize(350, 80);
    setMaximumSize(350, 80);
    setMinimumSize(350, 80);

    infoText.setParent(this);
    infoText.setGeometry(5, 5, 345, 20);
    infoText.setText(Info);
    infoText.show();

    progressBar.setParent(this);
    progressBar.setGeometry(3, 40, 347, 30);
    progressBar.show();
}

NBN_ProgressWidget::~NBN_ProgressWidget()
{

}

void NBN_ProgressWidget::setText(QString text)
{
    infoText.setText(text);
}

void NBN_ProgressWidget::setProgress(unsigned int progress, unsigned int total)
{
    progressBar.setMaximum(total);
    progressBar.setValue(progress);

    infoText.setText("Loading...");
}

void NBN_ProgressWidget::showWidget()
{
    this->show();
}

void NBN_ProgressWidget::hideWidget()
{
    this->hide();
}
